package com.qwz.dynamics;
/**
* @Description: 动态代理的客户端
* @Package com.qwz.dynamics.Client
* @author Qiuwuzhi
* @date 2019/12/23 13:54
* @version V1.0
*/
public class Client {
    public static void main(String[] args) {
        //张三先登录系统创建了一个订单
        Order order = new Order("设计模式",100,"zs");
        //创建动态代理，并把订单和动态代理关联起来
        OrderApi orderApi = new DynamicsProxy().getProxyinterface(order);
        orderApi.setOrderNum(10,"ls");
        System.out.println("ls修改后的订单记录没有变化："+orderApi);
        orderApi.setOrderNum(123,"zs");
        System.out.println("zs修改后，订单记录："+orderApi);
    }
}
